home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / programs / lw5starttoaster < prev    next >
Text File  |  1999-03-08  |  4KB  |  152 lines

  1. /* StartToaster V2.1 -- Have the flyer start up however you like.      */
  2. /* By Bob Caron (Grue) © 1995 NewTek Inc.                              */
  3. /* post4 line CB */
  4. /* © 1998  NewTek, Inc., of Texas */
  5.  
  6. OPTIONS RESULTS
  7. TOASTERLIB="ToasterARexx.port"
  8.  
  9. call remlib('rexxsupport.library')
  10. call addlib("rexxsupport.library", 0,-30,0)
  11. call remlib('ToasterARexx.port')
  12. call remlib('PROJECT_REXX_PORT')
  13.  
  14. if ~exists("toaster:") then do
  15.   say "Start Toaster V2.1"
  16.   say
  17.   say "Your Toaster: assignment is missing, or has been removed."
  18.   say
  19.   say "Some possible solutions:"
  20.   say
  21.   say "1) Reboot your computer and try again."
  22.   say "2) Re-Install your Toaster/Flyer software."
  23.   say "   (A minimal install is sufficient.)"
  24.   say
  25.   say "Press <Return> to continue."
  26.   pull stuff
  27.   call quit
  28.   end
  29.  
  30. if ~exists("toaster:programs/videotoaster") then do
  31.   say "Start Toaster V2.1"
  32.   say
  33.   say "I can't find the program 'VideoToaster' (needed for this software to run)."
  34.   say
  35.   say "Some possible reasons for this failure:"
  36.   say
  37.   say "1) Your toaster: assign may be pointing to the wrong location."
  38.   say "2) You are running ScreamerNet. StartToaster MUST be run before you"
  39.   say "   run a ScreamerNet node."
  40.   say "3) Your Toaster software is missing important system files."
  41.   say "   Run CheckSoftware to verify."
  42.   say
  43.   say "Press <Return> to continue."
  44.   pull stuff
  45.   call quit
  46.   end
  47.  
  48. startdir="toaster:arexx/editor/StartUpScripts"
  49.  
  50. if exists(startdir) then startup=1
  51. else startup=0
  52.  
  53. dir=showdir(startdir,'f','*')
  54. temp=translate(dir,'?',' ','?')
  55. temp2=translate(temp,' ','*',' ')
  56. dir = temp2
  57.  
  58. IF SHOW('Ports','PROJECT_REXX_PORT') THEN
  59.   IF ADDLIB('ToasterARexx.port' , 0) THEN x=Bummer("The Video Toaster/Flyer software is already running!! ")
  60.  
  61. call pragma("D","toaster:programs")
  62.  
  63. address command "run >NIL: toaster:programs/videotoaster"
  64.  
  65. do while ~SHOW('Ports','PROJECT_REXX_PORT')
  66.    address command "c:wait 1"
  67. end
  68.  
  69. call addlib('PROJECT_REXX_PORT' , 0)
  70. call addlib('ToasterARexx.port' , 0)
  71.  
  72. /* Add Startup Code here... */
  73. address command "avail flush"
  74. address command "copy libs:post4.library libs:post.library"
  75. address command "copy libs:psnf4.library libs:psnf.library"
  76. address command "assign ttmp: toaster:programs"
  77. address command "protect ttmp:LightWave.FP add rwed"
  78. address command "protect ttmp:Modeler.FP add rwed"
  79. address command "protect ttmp:LWSN.FP add rwed"
  80. address command "copy ttmp:LightWave.FP5 ttmp:LightWave.FP"
  81. address command "copy ttmp:Modeler.FP5 ttmp:Modeler.FP"
  82. address command "copy ttmp:LWSN.FP5 ttmp:LWSN.FP"
  83. address command "assign ttmp:"
  84. address command "assign ttmp: toaster:programs/lightwave_support"
  85. address command "protect ttmp:LW-config add rwed"
  86. address command "protect ttmp:MOD-cong add rwed"
  87. address command "protect ttmp:ModelerMacroList add rwed"
  88. address command "copy ttmp:LW-config5 ttmp:LW-config"
  89. address command "copy ttmp:MOD-config5 ttmp:MOD-config"
  90. address command "copy ttmp:ModelerMacroList5 ttmp:ModelerMacroList"
  91. address command "assign ttmp:"
  92.  
  93.  
  94. call set_view(4)
  95.  
  96. if startup=1 then do
  97.    loopto=words(dir); loop=1
  98.    do while (loop<loopto+1)
  99.       program=translate(word(dir,loop),' ','?')
  100.       filenam=program
  101.       if upper(right(program,5))=".REXX" then
  102.          filenam=left(program,length(filenam)-5)
  103.       if isarexx(startdir||"/"||program) then
  104.          number=LADDTOOL(filenam,startdir||"/"||program||" 1",1)
  105.       if number=12 then break
  106.       loop=loop+1
  107.    end
  108. end
  109.  
  110. /* End of code. */
  111.  
  112. quit:
  113.  
  114. call remlib('ToasterARexx.port')
  115. call remlib('PROJECT_REXX_PORT')
  116. call remlib('rexxsupport.library')
  117. exit
  118.  
  119. bummer: /* <- An Arnie like error system */
  120. parse arg message
  121. say "Start Toaster V2.1"
  122. say
  123. say message
  124. address command "c:wait 3"
  125. exit
  126.  
  127. isarexx:
  128. parse arg file
  129. if exists(file) then do
  130.     if open('infile',file,'READ') then do
  131.        filestart = readch('infile',2)
  132.        call close('infile')
  133.        if filestart="/*" then return 1
  134.     end
  135. end
  136. return 0
  137.  
  138. laddtool: procedure
  139. parse arg filenam,start,number
  140.  
  141. signal on error
  142. signal on syntax
  143.  
  144. call ADDTOOL(filenam,start,number)
  145.  
  146. syntax:
  147. error:
  148.  
  149. signal off error
  150.  
  151. return rc
  152.